package workflow.element {
import flash.events.MouseEvent;

import mx.events.FlexEvent;

import workflow.constant.DragConst;
import workflow.skin.RectangleNodeSkin;

public class RectangleNode extends NodeElementBase {

	public function RectangleNode() {
		super();

		setStyle("skinClass", Class(RectangleNodeSkin));
	}

	[SkinPart(required="true")]
	public var rightBottom:ElementAdjuster;

	override protected function getElementType():String {
		return DragConst.TYPE_NODE_RECTANGLE;
	}

	private function mouseMoveHandler(e:MouseEvent):void {
		if (e.buttonDown) {
			trace("adjuster mouseMoveHandler: " + e.currentTarget.toString());
			trace("adjuster: " + e.stageX + ", " + e.stageY);
		}
	}

	override protected function partAdded(partName:String, instance:Object):void {
		super.partAdded(partName, instance);

		if (instance == rightBottom) {
			rightBottom.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
		}
	}
}
}
